home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / ease-3.5 / utils / cfdiff.csh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1991-02-26  |  576 b   |  34 lines

  1. #!/bin/csh -f
  2. # Bruce Barnett
  3. # usage:
  4. # cfdiff file1.cf file2.cf
  5. # this removes all comments from the cf file
  6. if ( $#argv != 2 ) then
  7.     echo usage cfdiff file1 file2
  8.     exit 1
  9. endif
  10. onintr bomb
  11. # if SunOS, use the -b -w option
  12. set DIFF = "diff -b"
  13. if ( -f /bin/arch ) then
  14.     if ( `/bin/arch` =~ sun* ) then
  15.         set DIFF = "diff -b -w"
  16.     endif
  17. endif
  18. if ( ! -f $1 ) then
  19.     echo file $1 does not exist
  20.     exit 1
  21. endif
  22. if ( ! -f $2 ) then
  23.     echo file $2 does not exist
  24.     exit 1
  25. endif
  26. cfstrip <$1>/tmp/$1:t
  27. cfstrip <$2>/tmp/$2:t
  28.  
  29. cd /tmp
  30. ${DIFF} $1:t $2:t
  31.  
  32. bomb:
  33.     /bin/rm /tmp/$1:t /tmp/$2:t
  34.